//
// Created by 沙龙腾 on 2023/8/26.
//
#include <cstdlib>
#include "stdio.h"
#include "sum.h"


int main() {
    int n = 8;
    //定义个数组
    int *A = (int *) malloc(n * sizeof(int)); //ToDo: check NULL != A
    for (int i = 0; i < n; i++)
    {
        A[i] = i;
//        printf("%d\t",A[i]);
    }
    //数组求和
    printf("线性迭代版数组求和：%d\n",sum1(A,n));
    printf("线性递归版数组求和：%d\n",sum2(A,n));
    printf("二分递归版数组求和：%d\n",sum3(A,0,n));
}